module executor.message.MessageStatusExecutor;

import msgtrans;
import message.Constants;
import message.MsgDefine;
import google.protobuf;
import hunt.logging;
import std.array;
import std.conv : to;
import hunt.util.Serialize;
import client.GateServerClient;
import client.MsgServerClient;
import service.FriendService;

//消息状态模块

@TransportServer(LogicServerName)
class MessageStatusExecutor : AbstractExecutor!(MessageStatusExecutor) {
  //设置已读消息接口
  @MessageId(MESSAGE.CMD_SET_MSG_READ_REQ)
  void msgRead(TransportContext ctx, MessageBuffer buffer) {
    auto req = new AlreadyReadREQ();
    buffer.data.fromProtobuf!AlreadyReadREQ(req);

    FriendService.setMsgRead(req.clientId, req.chatId, req.timestamp);
  }
}

